package cn.wangqi.personal.alipay.util.webconfig;

import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by admin on 2017/8/10.
 */
public class AlipayConfig {
    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016082000296062";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC5kqpXGZ/e8SppRAvt7ng9fP0yu1ApUfRTAQSEsAAWF/Yi+cjjllCV9AfPALTcf4mqqiMLJ0zcz9oeas/9O1urWewnb64uFMpqfLs+FBRLyyfT/3PvAGULnJp2JDpODl9f49VZj+yl72PE1cSGzYxof6Sxjg7LztHjDL6aeLS9wIMcWMqta1tuZPZY/Q0sHp9B0EhBcUSKuYsYU0Q0psSo75rJ8iVK7K2GwMUfJOEemC+eUyFdXkbZ6ciOL0nu62Mt1HWe9rA0M9z39EkyWqpvpQC5A2xN4U1WS3SR9LcOX40JDY3UTLdmV5MPH5EsGX+UqgIbzTE/gGAymhI+psl3AgMBAAECggEBAKO2kVJgB9tuFUViw8d3f1p3nwSXnaOmao6jsjHA94KGRx4aETE+1f9El3L2o5h3Z6NJj7ryQ+v17u6wuqckK74iiaVM8HQ04VJKkgG1QyaOpqdvkP7D8WDqGpapZUqhgWCeJgVqZJMLe5AWKtfmFL3IBiqiMcl5v064Wpr6bDGNVqHbN4L7QDILDlXfMqQK3BJYnJru0iI6AZjEoQsnEqF6/SSs7Id+RO5+mWZGAMUFxSEKc2i+ZLV9d8qLQnEJVS29DQXaC60l+AOlFcX6B7XWcEsD8tA4HKjBeLxGZS/eufH6nXfcKb89OMl4nx0oOQpveDHz/KXUb7zlLLN6zmECgYEA9SHgd65Y0Pf76vsu59WSPjpkZY0KaYzgUsZSdLquR3SKz0Im8kooibCoyLyn5VBK5oTZ4YZwFmsbi4Lv0v5m+Ec+3ft+PZQdC8sG1Wv4swRFeoNO5bfk2mrLxsMmz77PTROe55yuGRW0hEgs56d67Q3xO24wibvmKzd0ycwZlIcCgYEAwczSCJLawTOhMzZSDjX3dsb6CyZf/NiXus/bXsBAhVlrnY73Z7WQ4L0wic26E+SNrqjyxHD9q8uWr72cfNBYm7v1DlRhqP9XO0Hv1SC9rPr+77rwn+Bj/iEfcHd6uLddKcJcI6Y2pt9AO/6shhjPjSlMUvcuzsfBDt2Jni8MT5ECgYBRCAHLjjaN3WvJIX8/47mUGHlXmGf4vDjrI+Pd8lfqBvxbxuJY9WqxGVSyBqr5grE/wmrDwk0LHBze4Uml1bL0H5kIiDoS4QM5AsQfiLGNe7v746wRA9kC2orCCYCq68hbEkFVDtX+NM6Xa8RsT1CzTAiSPLqOzS4o2wwgKPfLwQKBgH/jmfbuck1stMQG5L9b/aH0TK1u9Yj1pasx36H3XJyjFdEztzBJMQId1xoZGOJnwNexxgK8TapA/3+ZsNrs4oxizKRYKtpLJlWEfbA3mvO77uBkjMX0Xggl84lUTzf2SRR1njgoR4h3avwsY81aMh0FU8isNcdfKpeUumwYwBcBAoGBAMS+NaKyY+qx3j5qI1ikqCPjmB5J07qS6SFRu+bpsMiuE1dmOQ15ClEgOw5uDUL5sxT6+uqYPSgwzlM9FQN7gIkNw4U7i3aAnHg0/I3FHuagKHsJzZ99akcYptuGCU7p3YsKbQNio5lfk7XClTyzMArw78Bt+RYfKttt179R5Yid";

    // 支付宝公钥,不是用户公钥！！！！！！
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3t343pt8hy2/SDZX216FKJz3cX+riqt1QtHB7HwJOivgv3H6aiwhJjD6nMOZzg3pKjismUP5yS7isKSmmaBlV+JE228Sg4uJmy4Qwg9Op4R1l7pHl1N3OETtxvg9RqQYb6iEEQ0rgssm8lxKx0dcbF+e4b4ia5fYKn5EvxzctQf9kmexeUu3tvBmm5h0NdlhK5mo0QlA7TpsL53CQWvJ7XTTYQVug4/uQiRh4CfOMJ4oyp6Mm0Zfrquw7yeM6J37lMZnCjJZkG2hEbxm2jT7UZKlzWl0DR01mftS8V6w+CEB0ZPRC5GIfas1dBY93uWO1Lc+TMY4hcgfeUkZxBLcGwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://881e14b5.ngrok.io/alipay/notify.html";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://881e14b5.ngrok.io/alipay/success.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter("alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
